#include "winman.h"

WinMan::WinMan(QObject *parent)
    : QObject{parent}
{
    // 初始化GPS
    //gp.startSimulation(true);
    homePage.show();

    // 打开摄像头页面
    connect(&homePage, &Widget::jumpToCameraWin, this, [this](){
        cameraPage.show();
        homePage.hide();
    });

    // 摄像头返回主页
    connect(&cameraPage, &CameraWin::jumpToWidget, this, [this](){
        cameraPage.hide();
        homePage.show();
    });

    //打开地图页面
    connect(&homePage, &Widget::jumpToMapWin,this,[this](){
        mapPage.show();
        homePage.hide();
    });

    //地图返回页面
    connect(&mapPage,&MapWin::jumpToWidget,this,[this](){
        mapPage.close();
        homePage.show();
    });


}
